var system = require('system');

var url=decodeURIComponent(system.args[1]);
//对url进行判断是哪个购物平台的,并进行对应处理

if(url.indexOf('detail.tmall.com') > -1 || url.indexOf('detail.yao.95095.com') > -1){   //tmall
    var tmall = require('./crawler/tmall');
    tmall.tmallCrawler(url,obj=>{
       console.log(JSON.stringify(obj)); 
    });
}else if(url.indexOf('item.taobao.com') > -1){    //taobao
    var taobao = require('./crawler/taobao');
    taobao.taobaoCrawler(url,obj=>{
       console.log(JSON.stringify(obj)); 
    });
}else if(url.indexOf('item.jd.com') > -1){    //jd
    var jd = require('./crawler/jd');
    jd.jdCrawler(url,obj=>{
       console.log(JSON.stringify(obj)); 
    });
}else if(url.indexOf('detail.1688.com') > -1){    //1688
    var alibaba = require('./crawler/alibaba');
    alibaba.alibabaCrawler(url,obj=>{
       console.log(JSON.stringify(obj)); 
    });
}


